﻿/**************************************************************************
创建日期:	2019/7/18 16:05:45     
作	  者:	张存
邮 	  箱:	zhangcunliang@126.com
创建时间:	
Copyright (c)  ZhCun.cn

描	述：
记	录：
***************************************************************************/
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.DrawingCore.Imaging;
using System.IO;
using System.Text;
using ZhCun.Utils.Helpers;
using ZhCun.WebCommon.AL;

namespace ZhCun.WebCommon.WebPage
{
    public class PageUserBaseController<TALUser> : PageAuthorizeController<TALUser>
         where TALUser : ALUserBase, new()
    {
        ///// <summary>
        ///// 数字验证码
        ///// </summary>
        //[NonAction]
        //protected FileContentResult NumberVerifyCode()
        //{
        //    string code = VerifyCodeHelper.GetSingleObj().CreateVerifyCode(VerifyCodeHelper.VerifyCodeType.NumberVerifyCode);
        //    byte[] codeImage = VerifyCodeHelper.GetSingleObj().CreateByteByImgVerifyCode(code, 100, 40);
        //    return File(codeImage, @"image/jpeg");
        //}

        ///// <summary>
        ///// 字母验证码
        ///// </summary>
        ///// <returns></returns>
        //public FileContentResult AbcVerifyCode()
        //{
        //    string code = VerifyCodeHelper.GetSingleObj().CreateVerifyCode(VerifyCodeHelper.VerifyCodeType.AbcVerifyCode);
        //    var bitmap = VerifyCodeHelper.GetSingleObj().CreateBitmapByImgVerifyCode(code, 100, 40);
        //    MemoryStream stream = new MemoryStream();
        //    bitmap.Save(stream, ImageFormat.Png);
        //    return File(stream.ToArray(), "image/png");
        //}

        ///// <summary>
        ///// 混合验证码
        ///// </summary>
        ///// <returns></returns>
        //public FileContentResult MixVerifyCode()
        //{
        //    string code = VerifyCodeHelper.GetSingleObj().CreateVerifyCode(VerifyCodeHelper.VerifyCodeType.MixVerifyCode);
        //    var bitmap = VerifyCodeHelper.GetSingleObj().CreateBitmapByImgVerifyCode(code, 100, 40);
        //    MemoryStream stream = new MemoryStream();
        //    bitmap.Save(stream, ImageFormat.Gif);
        //    return File(stream.ToArray(), "image/gif");
        //}
    }
}